import 'package:duqin/config/app_colors.dart';
import 'package:duqin/util/util.dart';
import 'package:flutter/material.dart';

class CommentLikeRead extends StatelessWidget {
  final int commentCount;
  final int thumbUpCount;
  final int readCount;
  const CommentLikeRead(
      {Key? key,
      this.commentCount = 0,
      this.thumbUpCount = 0,
      this.readCount = 0})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceAround,
      children: [
        _iconCount('assets/images/icons/comment.png', commentCount),
        _iconCount('assets/images/icons/like.png', thumbUpCount),
        _iconCount('assets/images/icons/read.png', readCount),
      ],
    );
  }

  _iconCount(String icon, int count) {
    return Row(
      children: [
        Image.asset(
          icon,
          width: 14,
          height: 14,
        ),
        SizedBox(
          width: 4,
        ),
        Text(
          formatCharCount(count),
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
          style: TextStyle(color: AppColors.un3active, fontSize: 12),
        )
      ],
    );
  }
}
